package son.vpoint.dinokids;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.LinearLayout;

public class OperatorSelected extends Activity implements OnClickListener{
	LinearLayout ln_add;
	LinearLayout ln_Sub;
	LinearLayout ln_Mult;
	LinearLayout ln_Devic;
	LinearLayout ln_Mix;
	private Button btnHome;
	
	public int mSelecOperator = 0;
	protected void onCreate(Bundle savedInstanceState) {
		
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setContentView(R.layout.screen2);
		ln_add =(LinearLayout)findViewById(R.id.ln_add);
		ln_add.setOnClickListener(this);
		ln_Sub =(LinearLayout)findViewById(R.id.ln_sub);
		ln_Sub.setOnClickListener(this);
		ln_Devic =(LinearLayout)findViewById(R.id.ln_divi);
		ln_Devic.setOnClickListener(this);
		ln_Mix =(LinearLayout)findViewById(R.id.ln_mix);
		ln_Mix.setOnClickListener(this);
		ln_Mult =(LinearLayout)findViewById(R.id.ln_mult);
		ln_Mult.setOnClickListener(this);
		btnHome =(Button)findViewById(R.id.btn_home);
		btnHome.setOnClickListener(this);

	}
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_BACK) {
			finish();
			Intent i = new Intent(OperatorSelected.this, MainActivity.class);
			startActivity(i);
			
		}
		return super.onKeyDown(keyCode, event);
		
	}
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.ln_add:
			mSelecOperator =1;
			Intent i = new Intent(OperatorSelected.this, GameActivity.class);
			OperatorSelected.this.startActivity(i);
			OperatorSelected.this.finish();
			
			break;
		case R.id.ln_sub:
			mSelecOperator =2;
			Intent i1 = new Intent(OperatorSelected.this, GameActivity.class);
			OperatorSelected.this.startActivity(i1);
			OperatorSelected.this.finish();
			
			break;
		case R.id.ln_mult:
			mSelecOperator =3;
			Intent i2 = new Intent(OperatorSelected.this, GameActivity.class);
			OperatorSelected.this.startActivity(i2);
			OperatorSelected.this.finish();
			
			break;
		case R.id.ln_divi:
			mSelecOperator =4;
			Intent i3 = new Intent(OperatorSelected.this, GameActivity.class);
			OperatorSelected.this.startActivity(i3);
			OperatorSelected.this.finish();
			
			break;
		case R.id.ln_mix:
			mSelecOperator =5;
			Intent i4 = new Intent(OperatorSelected.this, GameActivity.class);
			OperatorSelected.this.startActivity(i4);
			OperatorSelected.this.finish();
			
			break;
			
			case R.id.btn_home:
				Intent i5 = new Intent(OperatorSelected.this, MainActivity.class);
				OperatorSelected.this.startActivity(i5);
				OperatorSelected.this.finish();
				break;
		default: mSelecOperator =0;
			break;
		}
		
	}

}
